package com.ww.springboot.mybatis.data.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ww.springboot.mybatis.handle.MyStringTypeHandle;
import com.ww.springboot.mybatis.handle.MyTimeStampTypeHandle;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;

import java.util.Date;

/**
 * 描述：
 *
 * @author wanwei
 * @since 2021-07-12 16:06
 */
@Data
@TableName(value = "mybatis_type_test", autoResultMap = true)
//@TableName(value = "mybatis_type_test")
@EqualsAndHashCode()
public class TypeTest {

    private Long id;

    @TableField(typeHandler = MyStringTypeHandle.class, jdbcType = JdbcType.VARCHAR)
    private String sTest;

    private Long lTest;

    @TableField(typeHandler = MyTimeStampTypeHandle.class, jdbcType = JdbcType.BIGINT)
    private Date timeTest;
}
